import java.util.Scanner;
public class Main {
/*    public static void main(String[] args) {
        Scanner cin=new Scanner(System.in);
        //int k=cin.nextInt();
        while (cin.hasNext()){
            int a=cin.nextInt();
            int b=cin.nextInt();
            if(a==0&&b==0){
                return;
            }
            System.out.println(a+b);
        }
    }*/
    public static void main(String[] args) {
        Scanner cin=new Scanner(System.in);
        while (cin.hasNext()){
            String[] strings = cin.nextLine().split(" ");
            int n=Integer.parseInt(strings[0]);
            if(n==0) return;
            int res=0;
            for (int i = 1; i <= n; i++) {
                res+=Integer.parseInt(strings[i]);
            }
            System.out.println(res);
        }
    }
}
